import React from 'react';
import $ from 'jquery';
import './UserGist.css';
class UserGist extends React.Component {
    constructor(props) {
        super(props);
        this.state = {rows:[]};
    }
    componentDidMount() {
      this.serverRequest = $.get(this.props.source, function (result) {
        console.log(result.list);
        const  lastGist = result.list;
        
        this.setState({
          rows:lastGist
        });
      }.bind(this));
    }
   
    componentWillUnmount() {
      this.serverRequest.abort();
    }
   // <ul key={row.id}><img src={row.url} className="imgClass" /></ul>
    render() {
      return (<div>
          {this.state.rows.map((row) => (
            <table border="1">
              <tr>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
                <td><ul key={row.id}><img src={row.url} className="imgClass" /></ul></td>
              </tr>
            </table>
              
          ))}
      </div>
      );
    }
  }
  export default UserGist;